package middle;

import java.util.Arrays;
import java.util.Scanner;

/**
 * ZJ25 头条校招
 * @author d3y1
 */
public class ZJ25{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);

        while(in.hasNext()){
            solution(in);
        }
    }

    /**
     * 模拟法: 贪心
     * @param in
     */
    private static void solution(Scanner in){
        int N = in.nextInt();
        int[] D = new int[N+1];

        for(int i=1; i<=N; i++){
            D[i] = in.nextInt();
        }

        Arrays.sort(D);

        int count = 0;
        int gap;
        if(N == 1){
            System.out.println(2);
        }else{
            for(int i=1; i+1<=N; i++){
                gap = D[i+1]-D[i];
                if(gap > 20){
                    count += 2;
                }else if(gap > 10){
                    count += 1;
                    i++;
                }else{
                    if(i+1 < N){
                        gap = D[i+2]-D[i+1];
                        if(gap > 10){
                            count += 1;
                            i++;
                        }else{
                            i += 2;
                        }
                    }else{
                        count += 1;
                        i++;
                    }
                }
            }

            // 最后剩下一个未处理(只存在 剩下一个 的情形)
            if((N+count)%3 != 0){
                count += 2;
            }

            System.out.println(count);
        }
    }
}